package myapp.DTO;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

public class ServiceDTO implements Serializable{
	private int id;
	private String name;
	private int categoryId;
	private double latitude;
	private double longtitude;
	private String address;
	private String phone;
	private String description;
	
	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public int getCategoryId() {
		return categoryId;
	}

	public double getLatitude() {
		return latitude;
	}

	public double getLongitude() {
		return longtitude;
	}

	public String getAddress() {
		return address;
	}
	
	public String getPhoneNumber()
	{
		return phone;
	}
	
	public String getDescription()
	{
		return description;
	}

	public ServiceDTO(String _name, int _category, double _latitide, double _longitude, 
			String _address, String _phone, String _description){
		name = _name;
		categoryId = _category;
		latitude = _latitide;
		longtitude = _longitude;
		address = _address;
		phone = _phone;
		description = _description;
	}
	
	public ServiceDTO(int _id, String _name, int _category, double _latitide, double _longitude, 
			String _address, String _phone, String _description){
		id = _id;
		name = _name;
		categoryId = _category;
		latitude = _latitide;
		longtitude = _longitude;
		address = _address;
		phone = _phone;
		description = _description;
	}
	
	public JSONObject toJson() throws JSONException{
		JSONObject json = new JSONObject();
		json.put("ServiceName", this.name);
		json.put("Category", this.categoryId);
		json.put("Latitude", this.latitude);
		json.put("Longtitude", this.longtitude);
		json.put("Address", this.address);
		json.put("Phone", this.phone);
		json.put("Description", this.description);
		
		return json;
	}
	
}
